package com.czl.base.data.bean.tengyun;

import android.text.TextUtils;

import java.util.List;

/**
 * @author by xubin,
 * @date on 2022/2/14.
 * PS: Not easy to write code, please indicate.
 */
public class StockListBean {
    /**
     * sortModel : 001
     * inventoryDate : 2019-06-13
     * stockNum : 20
     * productModel : xx01
     * productCode : 001
     */

    private String sortModel;
    private String inventoryDate;
    private int stockNum;
    private String productModel;
    private String productCode;

    public String getSortModel() {
        return sortModel;
    }

    public void setSortModel(String sortModel) {
        this.sortModel = sortModel;
    }

    public String getInventoryDate() {
        return inventoryDate;
    }

    public void setInventoryDate(String inventoryDate) {
        this.inventoryDate = inventoryDate;
    }

    public int getStockNum() {
        return stockNum;
    }

    public void setStockNum(int stockNum) {
        this.stockNum = stockNum;
    }

    public String getProductModel() {
        return productModel;
    }

    public void setProductModel(String productModel) {
        this.productModel = productModel;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public static String getMaxInventoryDate(List<StockListBean> stockList) {
        if (stockList == null || stockList.size() == 0) {
            return null;
        }
        long time = 0;
        String maxDate = null;
        for (StockListBean stockListBean : stockList) {
            String inventoryDate = stockListBean.getInventoryDate();
            if (TextUtils.isEmpty(inventoryDate)) {
                continue;
            }
            /*long tempTime = DateUtils.stringToLong(inventoryDate, DateUtils.YYYY_MM_DD);
            if (time < tempTime) {
                time = tempTime;
                maxDate = inventoryDate;
            }*/
        }
        return maxDate;
    }
}
